<?php

class authenticationActions extends sfActions {
    
    public function executeIndex(sfWebRequest $request){
        
    }
    
    public function executeLogin(sfWebRequest $request){
        $user = UserPeer::doSelectOne(new Criteria());
        
        $this->getUser()->setAuthenticated(true);
        $this->getUser()->setAttribute('current_user',$user);
        $this->redirect('@homepage');
    }
    
    public function executeLogout(sfWebRequest $request){
        $this->getUser()->getAttributeHolder()->clear();
        $this->getUser()->setAuthenticated(false);
        $this->redirect('@homepage');
    }
    
}